<template>
  <div class="adminyijianfankui">
    <admin_top></admin_top>
    <div style="padding: 0 20px;">
      <el-table :data="tableData" style="text-align: center;" align="center" border :loading="loading">
        <el-table-column label="店铺名称" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.id }}</span>
          </template>
        </el-table-column>
        <el-table-column label="授权状态" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.user_name }}</span>
          </template>
        </el-table-column>
        <el-table-column label="店铺session" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.shop_name }}</span>
          </template>
        </el-table-column>
        <el-table-column label="cookie" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.created_at }}</span>
          </template>
        </el-table-column>
        <el-table-column label="自动发货" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.title }}</span>
          </template>
        </el-table-column>
        <el-table-column label="同步备注" align="center">
          <template slot-scope="scope">
            <span>{{ scope.row.mobile }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center">
          <template slot-scope="scope">
            <div style="text-align: center; color: #409EFF; cursor: pointer;" @click="chakan(scope.row)">查看</div>
          </template>
        </el-table-column>
      </el-table>
      <div class="fenye" style="padding: 20px; text-align: right;">
        <el-pagination background layout="prev, pager, next" @current-change="fanye" :page-size="all.page_size"
          :total="total"></el-pagination>
      </div>
    </div>
    <!-- 查看图片 -->
    <el-dialog title="查看详情" :visible.sync="showimg" width="600px">
      <div style="margin-bottom: 20px;">{{neirong.title}}</div>
      <div v-html="neirong.description"></div>
    </el-dialog>
  </div>
</template>

<script>
  import admin_top from './top.vue';
  import axios from 'axios'
  export default {
    components: {
      admin_top
    },
    name: 'adminyijianfankui',
    data() {
      return {
        all: {
          page_size: 20,
          page: 1,
        },
        tableData: "",
        total: "",
        loading: true,
        //搜索店铺名称
        imglink:'',
        showimg:false,
        neirong:""
      }
    },
    watch: {

    },
    computed: {

    },
    created() {
      this.getlist()
    },
    methods: {
      chakan:function(item){
        this.neirong = item
        this.showimg = true
      },
      //放大图片
      openimg(url){
        console.log(url)
        this.imglink = url
        this.showimg = true
      },
      fanye:function(){
        this.all.page++
        this.getlist()
      },

      //获取全部
      getlist: function() {
        var that = this
        
        axios.get('/api/plan-market/admin/outer_store/list',{params:this.all})
          .then(response => {
            if (response.data.msg.code == 0) {
              this.tableData = response.data.data.data
              this.total = response.data.data.total
              this.loading = false
            } else {
              this.$message.error(response.data.msg.info);
            }
          })
      }

    },

  }
</script>

<style scoped>
  img{ max-width: 100%;}
  .adminyijianfankui {
    background: #EAEAEA;
    min-height: 100vh;
    padding: 0px;
  }
  .t_btn_box{
    display: flex;
    justify-content: flex-end;
  }
</style>
